import os
_config = {
    "database":"d:/esapidb/database.db"
  }
if os.path.exists("c:\\esapicfg.data"): 
  with open("c:\\esapicfg.data") as f:
    _config = eval(f.read())
else:
  with open("c:\\esapicfg.data",'w') as f:
    f.write(str(_config))